home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / Zoo1.Dxr / 00005.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  5.0 KB  |  125 lines

  1. on exitFrame
  2.   global activeSprite, snap1, snap2, stickh1, stickh2, stickv1, stickv2
  3.   if not snap1 and not snap2 then
  4.     if (the locH of sprite activeSprite > (stickh1 - 70)) and (the locH of sprite activeSprite < (stickh1 + 70)) and (the locV of sprite activeSprite > (stickv1 - 40)) and (the locV of sprite activeSprite < (stickv1 + 40)) then
  5.       set the locH of sprite activeSprite to stickh1
  6.       set the locV of sprite activeSprite to stickv1
  7.       set snap1 to 1
  8.       puppetSound(0)
  9.       puppetSound("Floop.S")
  10.       updateStage()
  11.       wait(20)
  12.       puppetSound(0)
  13.     else
  14.       if (the locH of sprite activeSprite > (stickh2 - 70)) and (the locH of sprite activeSprite < (stickh2 + 70)) and (the locV of sprite activeSprite > (stickv2 - 40)) and (the locV of sprite activeSprite < (stickv2 + 40)) then
  15.         set the locH of sprite activeSprite to stickh2
  16.         set the locV of sprite activeSprite to stickv2
  17.         set snap2 to 1
  18.         puppetSound(0)
  19.         puppetSound("Floop.S")
  20.         updateStage()
  21.         wait(20)
  22.         puppetSound(0)
  23.       else
  24.         set the locH of sprite activeSprite to the mouseH
  25.         set the locV of sprite activeSprite to the mouseV
  26.       end if
  27.     end if
  28.   else
  29.     if snap1 and ((the mouseH < (stickh1 - 70)) or (the mouseH > (stickh1 + 70)) or (the mouseV < (stickv1 - 40)) or (the mouseV > (stickv1 + 40))) then
  30.       set the locH of sprite activeSprite to the mouseH
  31.       set the locV of sprite activeSprite to the mouseV
  32.       set snap1 to 0
  33.     end if
  34.     if snap2 and ((the mouseH < (stickh2 - 70)) or (the mouseH > (stickh2 + 70)) or (the mouseV < (stickv2 - 40)) or (the mouseV > (stickv2 + 40))) then
  35.       set the locH of sprite activeSprite to the mouseH
  36.       set the locV of sprite activeSprite to the mouseV
  37.       set snap2 to 0
  38.     end if
  39.   end if
  40.   updateStage()
  41.   go(the frame)
  42. end
  43.  
  44. on mouseUp
  45.   global activeSprite, snap1, snap2, homeH, homeV, incCount, LbalanceHList, LbalanceVList, RbalanceHList, RbalanceVList, RcurrentWeight, LcurrentWeight, side, onScaleList, tempName, oldActive
  46.   if ((the locH of sprite activeSprite <> homeH) or (the locV of sprite activeSprite <> homeV)) and (the name of cast the castNum of sprite activeSprite = tempName) then
  47.     if not snap1 and not snap2 then
  48.       set the visible of sprite oldActive to 1
  49.       set the visible of sprite activeSprite to 0
  50.       set the locH of sprite activeSprite to homeH
  51.       set the locV of sprite activeSprite to homeV
  52.       puppetSound("slow Boing.s")
  53.       updateStage()
  54.       wait(30)
  55.       puppetSound(0)
  56.       go("Start")
  57.     else
  58.       puppetSound("Toots.s")
  59.       updateStage()
  60.       wait(20)
  61.       puppetSound(0)
  62.       if snap1 then
  63.         if the name of cast the castNum of sprite activeSprite = tempName then
  64.           set the castNum of sprite 6 to the castNum of sprite 6 - integer(tempName)
  65.           set the castNum of sprite 11 to the castNum of sprite 11 + integer(tempName)
  66.           set tempNo to 5 - integer(tempName)
  67.           set the locH of sprite 11 to getAt(LbalanceHList, tempNo)
  68.           set the locV of sprite 11 to getAt(LbalanceVList, tempNo)
  69.           set the locH of sprite 12 to getAt(RbalanceHList, tempNo)
  70.           set the locV of sprite 12 to getAt(RbalanceVList, tempNo)
  71.           set LcurrentWeight to integer(tempName)
  72.           set tempNo to 6 * integer(tempName)
  73.           set the locV of sprite activeSprite to the locV of sprite activeSprite + tempNo
  74.           set side to "Left"
  75.           go("begin")
  76.           moveMiddle()
  77.         end if
  78.       end if
  79.     end if
  80.     if snap2 then
  81.       if the name of cast the castNum of sprite activeSprite = tempName then
  82.         set the castNum of sprite 6 to the castNum of sprite 6 + integer(tempName)
  83.         set the castNum of sprite 12 to the castNum of sprite 12 + integer(tempName)
  84.         set tempNo to 5 + integer(tempName)
  85.         set the locH of sprite 12 to getAt(RbalanceHList, tempNo)
  86.         set the locV of sprite 12 to getAt(RbalanceVList, tempNo)
  87.         set the locH of sprite 11 to getAt(LbalanceHList, tempNo)
  88.         set the locV of sprite 11 to getAt(LbalanceVList, tempNo)
  89.         set RcurrentWeight to integer(tempName)
  90.         set tempNo to 6 * integer(tempName)
  91.         set the locV of sprite activeSprite to the locV of sprite activeSprite + tempNo
  92.         set side to "Right"
  93.         go("begin")
  94.         moveMiddle()
  95.       end if
  96.     end if
  97.   else
  98.     set incCount to incCount + 1
  99.     set the visible of sprite oldActive to 1
  100.     set the visible of sprite activeSprite to 0
  101.     set the locH of sprite activeSprite to homeH
  102.     set the locV of sprite activeSprite to homeV
  103.     puppetSound("slow Boing.s")
  104.     updateStage()
  105.     wait(30)
  106.     puppetSound(0)
  107.     if incCount < 2 then
  108.       go("Start")
  109.     else
  110.       puppetSprite(2, 0)
  111.       puppetSprite(3, 0)
  112.       puppetSprite(4, 0)
  113.       puppetSprite(6, 0)
  114.       puppetSprite(10, 0)
  115.       puppetSprite(11, 0)
  116.       puppetSprite(12, 0)
  117.       puppetSprite(14, 0)
  118.       puppetSprite(15, 0)
  119.       puppetSprite(16, 0)
  120.       puppetSprite(17, 0)
  121.       go("show " & tempName)
  122.     end if
  123.   end if
  124. end
  125.